package com.yuxi.controller.manager;
import com.yuxi.common.SkJsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.web.bind.annotation.RestController;
import com.yuxi.pubInter.exception.SkException;
import com.yuxi.pubInter.IBaseService;
import com.yuxi.pubInter.RestfulController;
import com.yuxi.dto.ProductDTO;
import com.yuxi.dto.ProductPageDTO;
import com.yuxi.modelExt.ProductExt;
import com.yuxi.searchExt.ProductSearchExt;
import com.yuxi.service.IProductService;
import com.yuxi.vo.ProductDetailVO;
import com.yuxi.vo.ProductListVO;
import com.yuxi.vo.ProductDomainVO;
import com.yuxi.vo.ProductDetailDomainVO;

import org.springframework.validation.annotation.Validated;
import java.util.Set;
import java.util.HashSet;
import com.yuxi.pubInter.exception.BusinessException;

/**
*    @author sunke
*    @Date 2023-10-13 10:28:19
*    @description ProductController      产品
*/
@Api(tags = "后台管理系统-产品相关", description = "产品相关接口")
@RestController(value ="productRestfulController")
@RequestMapping("/manager/product/")
@Validated
public class ProductController extends ApiManageController<ProductDTO,ProductPageDTO,ProductExt, ProductSearchExt,ProductDomainVO,ProductDetailDomainVO,ProductDetailVO,ProductListVO,String> {

	@Resource(name = "productService")
	private IProductService productService;



	@Override
	public IBaseService<ProductExt, ProductSearchExt,String> getBaseService() throws SkException {
		return productService;
	}

	@Override
	public String getBaseRoute() {
		return "/manager/product/";
	}

	/**
	* 当前模板名称
	* @return
	*/
	@Override
	public String getModelName(){
		return "产品";
	}


	@Override
	public Set<String> totalMapSet() {
		Set totalMapSet=new HashSet();
		totalMapSet.add("count(product.p_id) as countNum");
		return totalMapSet;
	}


}